import { createStore } from 'redux'

//主reducer
const initState = {name: '张三'}
const reducer = (state = initState, action) => {
  if(action.type === 'CHANGE_NAME') {
    return {
      ...state,
      name: action.name
    }
  }
  return state
}
// }


const store = createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())

export default store